This folder contains the replication files for the PSRM article 
"The case for multiple UESDs and an application to migrant deaths in the Mediterranean Sea"
by Joris Frese (European University Institute).

All the necessary data and scripts to reproduce all analyses reported in that article can be accessed
by simply running the "Rep Main Script.R" script. 

By including the R project "UESD.Rproj" in the replication folder, all paths dependencies are functional.

It is recommended to run the scripts in the order that they are listed in the main script 
(otherwise certain dependencies between scripts may cause issues for reproducibility).

When running all scripts in the order from the main script, the following scripts produce the main outputs
in the paper and Appendix A:

1) The script "Rep Plots.R" produces Figure 1 from the paper (using outputs from the "Rep RDD.R" script
and data from the "Rep Pooled Meta Analysis.R" script).

2) The script "Rep RDD.R" produces the individual event tables in Appendix A5. For this script, I also
created the log file "Log_Rep_RDD.txt", which documents that all the RDD coefficients reported in the 
paper and Appendix are identical to those in the R console.

3) The script "Rep Pvalues.R" produces Figure 2 from the paper.

4) The script "Rep Pooled Meta Analysis.R" produces Figure 3 from the paper (and the remaining regression
results for lumped samples reported in Appendix A5 and the interaction plots in Appendix A7).
Note that this script takes a long time to run on most computers, as the kernel-estimator from
interflex is very computationally intensive with the large sample size from the lumped samples.
For a quick overview of the interactions, it is recommended to only run the code for the linear
interactions (estimator = 'linear'), which runs much faster.

5) The script "Rep Timeseries.R" produces the descriptive timeseries plots in Appendix A1 and A2.

6) The script "Rep Slope Analysis.R" produces the slope plots in Appendix A3 and A4.

7) The script "Rep Power.R" produces the power analyses reported in Appendix A6.

8) The script "Rep Fixed Effect Meta Analysis.R" produces the coefficients from fixed and random effects 
meta analyses.

The remaining scripts are either for data preparation or for secondary analyses reported in the
secondary Appendix on my GitHub (a link to the secondary Appendix B is included on the title page 
of the main Appendix A).
